<script>
	export default {
		onLaunch: function() {
			if (uni.canIUse('getUpdateManager')) {
				const updateManager = uni.getUpdateManager()
				updateManager.onCheckForUpdate(function(res) {
					// 请求完新版本信息的回调
					console.log(res.hasUpdate) //res.hasUpdate返回boolean类型
					if (res.hasUpdate) {
						updateManager.onUpdateReady(function() {
							uni.showModal({
								title: '更新提示',
								content: '新版本已经准备好，是否重启当前应用？',
								success(res) {
									if (res.confirm) {
										// 新的版本已经下载好，调用applyUpdate应用新版本并重启
										updateManager.applyUpdate()
									}
								}
							})
						})
						// 新版本下载失败时执行
						updateManager.onUpdateFailed(function() {
							uni.showModal({
								title: '发现新版本',
								content: '请删除当前小程序，重新搜索打开...',
							})
						})
					}
				})
			} else {
				//如果小程序需要在最新的微信版本体验，如下提示
				uni.showModal({
					title: '更新提示',
					content: '当前微信版本过低，无法使用该功能，请升级到最新微信版本后重试。'
				})
			}
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}, 
		created: function(){
			console.log('state', this.$store.state)
		}
	}
</script>

<style lang="scss">
	@import "/style/default.scss";
	@import "/style/table.scss";
	.van-skeleton__row, .van-skeleton__title  {
		height: 50rpx!important;
	}
	.van-skeleton {
		padding: 0 20rpx 0 0rpx!important;
	}
	.material-form-btn {
			z-index: 99;
			position: fixed;
			height: 90rpx;
			left: 0;
			right: 0;
			bottom: 0;
			border-radius: 0;
			line-height: 90rpx;
			background: linear-gradient(to right, #3350D9, #1152FC);
			color: #fff;
	}
	.van-cell__title {
		flex: 4!important;
	}
	.van-cell__value {
		flex: 1;
	}
	.grid-btn {
		width: 568rpx;
		height: 80rpx;
		line-height: 80rpx;
		margin-top: 100rpx;
		background-color: #2E85FB;
		color: #fff;
	}
	.van-empty {
		background-color: #fff;
	}
	
	/*每个页面公共css */
	:not(not) {
	  box-sizing: border-box;
	}
	.van-tab--active {
		color: #1152FC;
	}
	
	.van-ellipsis {
		color: #666;
		font-weight: bold;
		height: 80rpx !important;
		line-height: 80rpx !important;
		font-size: 28rpx;
		flex: 25%;
		flex-basis: 25% !important;
	}
	
	.van-tabs__line {
		width: 112rpx !important;
		height: 8rpx !important;
		// translateX: (28rpx) !important;
	}
	
	.van-tabs__wrap {
		border: 2rpx solid #eee;
		height: 80rpx !important;
		line-height: 80rpx !important;
	}
	
	.tab-active-class {
		color: #1152FC;
	}
	
	.order-content {
		width: 750rpx;
		padding: 30rpx 0 30rpx 49rpx;
		background-color: #fff;
		margin-bottom: 135rpx;
		// padding-left: 49rpx;
		// padding-top: 30rpx;
	
		.content-item {
			// height: 72rpx;
			padding: 20rpx 20rpx 20rpx 0;
			display: flex;
			align-items: center;
			font-size: 32rpx;
			view {
				font-size: 32rpx;
			}
			.item-name {
				// margin-right: 20rpx;
				width: 250rpx;
			}
		}
	
		.content-img {
			width: 100%;
			min-height: 280rpx;
			display: flex;
			margin-top: 40rpx;
	
			.img-item {
				width: 220rpx;
				height: 220rpx;
				margin-right: -10rpx;
	
				image {
					width: 100%;
					height: 100%;
				}
	
				&:last-child {
					margin-right: 0;
				}
			}
		}
	
		.sign-img {
			width: 100%;
			height: 280rpx;
			// background-color: pink;
			display: flex;
			padding-top: 40rpx;
	
			.left-text {
				width: 200rpx;
			}
	
			.sign-item {
				width: 220rpx;
				height: 220rpx;
	
				image {
					width: 100%;
					height: 100%;
				}
			}
		}
	
		.detail-item {
			width: 750rpx;
			height: 88rpx;
			display: flex;
			line-height: 88rpx;
			// padding-left: 20rpx;
			background-color: #fff;
			border-bottom: 2rpx solid #f5f5f5;
	
			.left {
				margin-right: 37rpx;
			}
	
			.sign {
				width: 115rpx;
				height: 88rpx;
	
				image {
					width: 100%;
					height: 100%;
				}
			}
	
			.name {
				margin-right: 26rpx;
			}
		}
	}
</style>
